package com.entity;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;

/**
 * 【经营项目】 项目信息维护
 */

@Entity
@Table(name = "project_info")
@Getter @Setter
public class BusinessProjectInfo extends BaseEntity {

    // 项目名称
    @Column(name = "project_name",  length = 100)
    private String projectName;

    // 项目合作公司名称
    @Column(name = "partner_company", length = 100)
    private String partnerCompany;

    // 开始时间
    @Column(name = "start_date")
    @Temporal(TemporalType.DATE)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startDate;

    // 结束时间
    @Column(name = "end_date")
    @Temporal(TemporalType.DATE)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endDate;

    // 分成比例
    @Column(name = "profit_ratio", precision = 7, scale = 4, columnDefinition = "DECIMAL(15,2) default 0")
    private BigDecimal profitRatio =  BigDecimal.ZERO;

    // 是否有保底
    @Column(name = "has_guarantee")
    private boolean hasGuarantee;

    // 保底金额
    @Column(name = "guarantee_amount", precision = 15, scale = 2, columnDefinition = "DECIMAL(15,2) default 0")
    private BigDecimal guaranteeAmount =  BigDecimal.ZERO;

    @Column(name = "status", columnDefinition = "TINYINT default 1")
    private Integer status;

    @Column(name = "remark", length = 500)
    private String remark;
}
